package com.stone.serverless.auth.matcher;

import org.springframework.util.AntPathMatcher;
import org.springframework.util.PathMatcher;

/**
 * @Description: TODO
 * @Author: MECHREVO
 * @Date: 2022/1/27 8:57
 * @Version: 1.0.0
 */
public class SaPathMatcherHolder {

    /**
     * 路由匹配器
     */
    public static PathMatcher pathMatcher;

    /**
     * 获取路由匹配器
     *
     * @return 路由匹配器
     */
    public static PathMatcher getPathMatcher() {
        if (pathMatcher == null) {
            pathMatcher = new AntPathMatcher();
        }
        return pathMatcher;
    }

    /**
     * 写入路由匹配器
     *
     * @param pathMatcher 路由匹配器
     */
    public static void setPathMatcher(PathMatcher pathMatcher) {
        SaPathMatcherHolder.pathMatcher = pathMatcher;
    }
}
